module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// install a JSONP callback for chunk loading
/******/ 	function webpackJsonpCallback(data) {
/******/ 		var chunkIds = data[0];
/******/ 		var moreModules = data[1];
/******/
/******/
/******/ 		// add "moreModules" to the modules object,
/******/ 		// then flag all "chunkIds" as loaded and fire callback
/******/ 		var moduleId, chunkId, i = 0, resolves = [];
/******/ 		for(;i < chunkIds.length; i++) {
/******/ 			chunkId = chunkIds[i];
/******/ 			if(installedChunks[chunkId]) {
/******/ 				resolves.push(installedChunks[chunkId][0]);
/******/ 			}
/******/ 			installedChunks[chunkId] = 0;
/******/ 		}
/******/ 		for(moduleId in moreModules) {
/******/ 			if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ 				modules[moduleId] = moreModules[moduleId];
/******/ 			}
/******/ 		}
/******/ 		if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ 		while(resolves.length) {
/******/ 			resolves.shift()();
/******/ 		}
/******/
/******/ 	};
/******/
/******/
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// object to store loaded and loading chunks
/******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ 	// Promise = chunk loading, 0 = chunk loaded
/******/ 	var installedChunks = {
/******/ 		8: 0
/******/ 	};
/******/
/******/
/******/
/******/ 	// script path function
/******/ 	function jsonpScriptSrc(chunkId) {
/******/ 		return __webpack_require__.p + "" + chunkId + ".js"
/******/ 	}
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/dist/";
/******/
/******/ 	// on error function for async loading
/******/ 	__webpack_require__.oe = function(err) { console.error(err); throw err; };
/******/
/******/ 	var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ 	var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ 	jsonpArray.push = webpackJsonpCallback;
/******/ 	jsonpArray = jsonpArray.slice();
/******/ 	for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ 	var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 70);
/******/ })
/************************************************************************/
/******/ ({

/***/ 1:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent(
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */,
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options =
    typeof scriptExports === 'function' ? scriptExports.options : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
          injectStyles.call(
            this,
            (options.functional ? this.parent : this).$root.$options.shadowRoot
          )
        }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}


/***/ }),

/***/ 41:
/***/ (function(module, exports) {

module.exports = require("@tinymce/tinymce-vue");

/***/ }),

/***/ 70:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./packages/editor/src/main.vue?vue&type=template&id=1e9757d2&
var render = function render() {
  var _vm = this,
    _c = _vm._self._c
  return _c("editor", {
    ref: "myMceEditor",
    attrs: { "tinymce-script-src": _vm.tinymceScriptSrc, init: _vm.editConfig },
    on: { onInit: _vm.onReady, onChange: _vm.onChange },
    model: {
      value: _vm.content,
      callback: function ($$v) {
        _vm.content = $$v
      },
      expression: "content",
    },
  })
}
var staticRenderFns = []
render._withStripped = true


// CONCATENATED MODULE: ./packages/editor/src/main.vue?vue&type=template&id=1e9757d2&

// EXTERNAL MODULE: external "@tinymce/tinymce-vue"
var tinymce_vue_ = __webpack_require__(41);
var tinymce_vue_default = /*#__PURE__*/__webpack_require__.n(tinymce_vue_);

// CONCATENATED MODULE: ./packages/editor/src/config.js
var basicConfig = {
  toolbars: "fontselect | fontsizeselect | bold italic underline forecolor | numlist bullist alignleft aligncenter alignright alignjustify | subscript superscript table imageupload formula",
  plugins: ["advlist lists fileUpload imagetools", "searchreplace", "table paste", "formula wordcount link"],
  config: {
    // base_url: 'ui',
    content_css: "editorLib/tinymce/skins/custom.content.css",
    // content_css: require('./tinymce/skins/custom.content.css'),
    // content_css: '',
    // language_url: `editorLib/tinymce/langs/zh_TW.js`, //中文包
    // language_url: require('./tinymce/langs/zh_CN.js'),
    theme: "silver",
    // skin_url: require("./tinymce/skins/ui/oxide/skin.min.css"),
    // skin_url: null,
    // skin: false,
    theme_url: "editorLib/tinymce/themes/silver/theme.min.js",
    icons_url: "editorLib/tinymce/icons/iconfont.js",
    // icons_url: require('./tinymce/icons/iconfont.js'),
    icons: "custom",
    // suffix: '.min',
    // language: "zh_TW", //中文
    branding: false, // 去水印
    elementpath: false, //禁用编辑器底部的状态栏
    menubar: false, // 隐藏最上方menu
    statusbar: true, // 隐藏编辑器底部的状态栏
    resize: false, //禁止调整编辑器大小
    toolbar_mode: "sliding",
    fontsize_formats: "14px 16px 18px 20px 24px 26px 28px 30px 32px 36px", //字体大小
    font_formats: "微软雅黑=Microsoft YaHei;苹果苹方=PingFang SC;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei, sans-serif;Arial=arial, helvetica, sans-serif;Arial Black=arial black, avant garde;Times New Roman=times new roman,times;", //字体
    fileTypeLimit: [{
      image: 'png,jpg,gif,jpeg,bmp'
    }],
    paste_data_images: true,
    paste_as_text: false,
    importcss_append: true
  }
};
/* harmony default export */ var config = (basicConfig);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/editor/src/main.vue?vue&type=script&lang=js&
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };


// import tinymce from 'tinymce/tinymce.min.js'
// import "tinymce/plugins/advlist"
// import "tinymce/plugins/lists"
// import "tinymce/plugins/imagetools"
// import "tinymce/plugins/searchreplace"
// import "tinymce/plugins/table"
// import "tinymce/plugins/paste"
// import "tinymce/plugins/wordcount"
// import "./tinymce/plugins/formula"
// import "./tinymce/plugins/fileUpload"
// import "tinymce/themes/silver/theme.min.js"
// import "tinymce/skins/ui/oxide/skin.min.css"; //富文本样式
// import "tinymce/icons/default"; //富文本样式

// import Uploader from "@/utils/upload.js";
// import { RESOURCE_SERVER_HOST } from "@/config";
// import Obs from 'ulearning-obs/dist/obs-huawei.js'

var vueI18nMap = {
  zh: 'zh_CN',
  tw: 'zh_TW',
  th: 'th_TH',
  ar: 'ar',
  id: 'id',
  es: 'es',
  en: 'en'
};
/* harmony default export */ var mainvue_type_script_lang_js_ = ({
  name: 'UlEditor',
  components: {
    editor: tinymce_vue_default.a
  },
  model: {
    prop: "value",
    event: "change"
  },
  props: {
    value: String,
    toolbarOptions: {
      type: String,
      default: function _default() {
        return config.toolbars;
      }
    },
    autoFocus: {
      type: Boolean,
      default: false
    },
    height: {
      type: Number,
      default: 500
    },
    allowPaste: {
      type: Boolean,
      default: true
    },
    options: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    uploaderConfig: {
      type: Object,
      default: function _default() {
        return {};
      }
    }
  },
  data: function data() {
    return {
      content: "",
      editor: null,
      tinymceScriptSrc: "editorLib/tinymce/tinymce.js",
      editConfig: _extends({}, config.config, this.options, {
        height: this.height, //富文本高度
        plugins: config.plugins, // 需加载的配置文件
        toolbar: [this.toolbarOptions, ''], //顶部菜单、底部菜单
        images_upload_handler: this.uploadImage, // 上传图片
        auto_focus: this.autoFocus, //是否自动聚焦
        language_url: "editorLib/tinymce/langs/" + (vueI18nMap[this.$i18n.locale] || 'zh_CN') + ".js", //中文包
        language: vueI18nMap[this.$i18n.locale] || 'zh_CN'
        // paste_preprocess: function(plugin, args) {
        //   console.log(args.content);
        //   args.content = 'helloworld';
        // }
      })
    };
  },
  created: function created() {
    console.log(98888888888);
    console.log(this.$i18n.locale);
    if (this.$i18n.locale != 'zh') {
      this.editConfig.font_formats = "Microsoft YaHei=Microsoft YaHei;PingFang SC=PingFang SC;Simsun=simsun,serif;FangSong=FangSong,serif;SimHei=SimHei, sans-serif;Arial=arial, helvetica, sans-serif;Arial Black=arial black, avant garde;Times New Roman=times new roman,times;";
    }
    // this.editConfig = { ...basicConfig.config, ...this.editConfig };
    if (!this.allowPaste) {
      this.editConfig.paste_preprocess = function (plugin, args) {
        args.stopImmediatePropagation();
        args.stopPropagation();
        args.preventDefault();
      };
    }
    this.getObs();
  },

  // mounted () {
  //   tinymce.init({})
  // },
  watch: {
    value: function value() {
      this.content = this.value;
    }
  },
  methods: {
    onReady: function onReady(_ref) {
      var target = _ref.target;

      console.log("ready!", target);
      this.content = this.value;
      this.editor = target;
    },
    onChange: function onChange(_ref2) {
      var target = _ref2.target;

      console.log("editor change!", target);
      this.content = target.getContent();
      this.$emit("change", this.content);
    },
    getObs: function getObs() {
      var _this = this;

      if (this.uploaderConfig.mode === 'qiniu') {
        Promise.resolve(/* import() */).then(__webpack_require__.t.bind(null, 85, 7)).then(function (module) {
          _this.Obs = module.default || module;
        });
      } else {
        Promise.resolve(/* import() */).then(__webpack_require__.t.bind(null, 84, 7)).then(function (module) {
          _this.Obs = module.default || module;
        });
      }
    },
    uploadImage: function uploadImage(file, success, failure) {
      var _this2 = this;

      // if (file.blob && file.blob()) {
      //   file = file.blob();
      // }
      console.log('image-upload');
      if (file.size > 5 * 1024 * 1024) {
        //TODO 添加弹窗提示
        failure("图片大小不能超过5M");
        this.editor.$("[src=\"" + file.blobUri() + "\"]")[0].remove();
        return;
      }
      var uploader = new this.Obs(this.uploaderConfig);
      if (file.base64 && file.base64()) {
        var base64 = file.base64();
        var arr = base64.split(','),
            mime = arr[0].match(/:(.*?);/);
        if (!mime) {
          base64 = 'data:image/png;base64,' + base64;
        }
        file = uploader.dataURLtoBlob(base64);
        file.ext = ".png";
      }

      uploader.startUpload(file);
      file.onSuccess = function () {
        console.log(file);
        success(uploader.obsHost + '/' + file.key);
      };
      file.onError = function (err) {
        failure("上传失败");
        _this2.editor.$("[src=\"" + file.blobUri() + "\"]")[0].remove();
      };
    }
  }
});
// CONCATENATED MODULE: ./packages/editor/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./packages/editor/src/main.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* hot reload */
if (false) { var api; }
component.options.__file = "packages/editor/src/main.vue"
/* harmony default export */ var main = (component.exports);
// CONCATENATED MODULE: ./packages/editor/index.js


main.install = function (vue) {
  vue.component(main.name, main);
};

/* harmony default export */ var editor = __webpack_exports__["default"] = (main);

/***/ }),

/***/ 84:
/***/ (function(module, exports) {

module.exports = require("ulearning-obs/dist/obs-huawei.js");

/***/ }),

/***/ 85:
/***/ (function(module, exports) {

module.exports = require("ulearning-obs/dist/obs-qiniu.js");

/***/ })

/******/ });